<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定时器</title>
</head>
<body>
  <SCRIPT>
    // 循环当前时间

    setInterval(function () {
      var date = new Date();
      var fullYear = date.getFullYear();
      var month = date.getMonth();
      var date1 = date.getDate();
      var hours = date.getHours();
      var seconds = date.getSeconds();
      var minutes = date.getMinutes();
      document.close();
      document.write(seconds)
    },1000)


   /* var i = 0;
    // 循环定时器 循环调用时间
    var interval = setInterval(function () {
      document.write("我是循环定时器" + i++ +"<br>");
      if(i===5){
        clearInterval(interval)
      }
    },1000);

    var timeout = setTimeout(function () {
      document.write("我是爆炸定时器")
    },1000);
    clearTimeout(timeout)*/

  </SCRIPT>
</body>
</html>